Hi - I have a few problems that will hopefully be a fairly easy fixes but i've not been able to find any existing posts (sorry if there are some).
I have some code that takes the object ID and inserts it into the start of the object text (so that the ID appears in-line with the object text on export). This code works by replacing the object text contents with object ID + object text. This works fine for all of the objects except for the few I have that are only composed of a Word OLE object and so there is essentially no text in them. This means that when the code runs on these objects it deletes the OLE and just pastes in the ID.
There may be a better way to do this but I assume the easiest way is instead of replacing the object text, just writing the ID into the front of the object, pushing the OLE to the right.
As an aside my goal is to try and get the ID itself appearing in the margin to the right of the object text, tabbing out unfortunately doesnt work due to differing field widths in DOORs and Word but I was wondering if I could assign a different paragraph style to the ID and achieve this that way - this would involve having two styles per object though and i'm not sure this is possible?
The final issue I have is that some of the Tables in the Word OLEs are longer than a page and upon export, do not wrap onto subsequent pages - research has implied this is a coded in limitation though. - Ideally I would just use a table inserted into the object text field but I can't find a way to adjust column size with these and a DOORs table is out of the question as I don't want to deal with every cell in the table being an object.
Again apologies if these issues have already been covered - this forum has been extremely helpful to me in the past and is always my first point of call for Doors issues.
The code I currently have for inserting the ID is below:
Module m = current
int intLength
string strObjText
intLength=length(identifier(obj))
strObjText=obj."Object Text" ""
if (null obj."Object Heading" "")
{
if (strObjText0:intLength-1!=identifier(obj))
{
obj."Object Text"=richText( "{\\b " identifier(obj) ": ""}" obj."Object Text""" )
}
}
DanBow - Fri Mar 16 04:24:50 EDT 2012 |
|
Re: Writing to the start of an object adevicq - Fri Mar 16 04:52:46 EDT 2012
Hi,
I tried this and it seems to work:
Object o = current
string txtOle
string stId = identifier(o)
txtOle = richTextWithOle(o."Object Text")
o."txt2" = richText("\\pard " stId ":\\pard " txtOle)
Regards,
Alain
|
|
Re: Writing to the start of an object SystemAdmin - Fri Mar 16 05:12:59 EDT 2012
I'm not sure if it is really necessary to have to add the Object ID to the Object Text just for the purposes of exporting to MS Word.
If all you want is to do is export the Object ID and the Main Column, then consider creating a View that only has these two columns, then use the built-in export to MSWord feature to export this view to MSWord using the Table format option. The two column view in DOORS will be replicated in MSWord as a two column table. If you don't like the table look-n-feel in MS Word, then just remove the table header row and the borders in MS Word and it no longer looks like a table - I usually just change the border colour from black to a light grey so that they are not so obtrusive but help to visually separate each row of information. Once an export is in MSWord, you have a large number of features in MSWord that can be used to fix up the look-n-feel very quickly. If you know how to create MSWord templates and configure styles, an export can be achieved with a minimal amount of extra post export fix ups. This might require a bit of trial and error, but I can assure you that this can deliver quite good repeatable results - it does help if you have good working knowledge of MSWord, but not essential.
As for the OLE issue - not an easy one to fix I'm afraid. Can these tables within the OLE be split into smaller tables and have one OLE for each? So instead of one long table in a single OLE, maybe you split it into two tables in two OLE's, and in the table caption for each table, you identify the first table as being 1 of 2, and the second as 2 of 2.
Paul Miller
Melbourne, Australia
|
|
Re: Writing to the start of an object SystemAdmin - Fri Mar 16 06:53:13 EDT 2012 adevicq - Fri Mar 16 04:52:46 EDT 2012
Hi,
I tried this and it seems to work:
Object o = current
string txtOle
string stId = identifier(o)
txtOle = richTextWithOle(o."Object Text")
o."txt2" = richText("\\pard " stId ":\\pard " txtOle)
Regards,
Alain
Or just use the Attribute Wizard (create a new Text type DXL Attribute, click on Wizard to start the wizard) to combine Object Identifier and Object Text including OLE objects
-
Pekka Mäkinen - http://www.softqa.eu/
|
|
Re: Writing to the start of an object DanBow - Fri Mar 16 08:00:14 EDT 2012
Thanks for all of your comments so far - regarding the table export this looks promising for getting the ID to appear "in the margin" although i'm having some issues with having blank cells here -I don't want the ID to appear when the object is a heading so i've adapted my previous code to send just the text object IDs to a separate attribute.
Not having anything in this new attribute for the heading object leaves a blank cell and with Word picking up the heading style from the nextdoor object text style, it auto numbers the the blank cels, adding spaces doesnt prevent this but adding some unique text and then find/replacing it with nothing appears to do the trick.
As for the OLE it does appear that splitting up the object will be the only way to do this but as it only applies to a couple of objects (tables) in the document this shouldn't be too much of an issue.
|
|
Re: Writing to the start of an object Des_Hao - Fri Mar 16 08:30:27 EDT 2012
Hi, I am sure that, you can write a script by yourself to print ID and Object texts together while exporting them in "Word". Because I had just finished a work including this purpose, but to export in "Excel". I think there are as many "Word" Functions as by Excel. Just find out a Word_Function file, as the Excel Functions I attached here. Than you can call them in your script. It will not be hard to write such a script.
Attachments
attachment_14801550_ExcelFunctions.inc
|
|
Re: Writing to the start of an object DanBow - Thu Mar 22 05:51:23 EDT 2012 adevicq - Fri Mar 16 04:52:46 EDT 2012
Hi,
I tried this and it seems to work:
Object o = current
string txtOle
string stId = identifier(o)
txtOle = richTextWithOle(o."Object Text")
o."txt2" = richText("\\pard " stId ":\\pard " txtOle)
Regards,
Alain
Thanks for your help everyone, I think i have resolved the issue.
|
|